import { Module } from '@nestjs/common';
import { from } from 'rxjs';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { DbModule } from '@libs/db'
import { UsersModule } from './users/users.module';
import { CoursesModule } from './courses/courses.module';
import { EpisodesModule } from './episodes/episodes.module';
import { MulterModule } from '@nestjs/platform-express';
import { CommonModule } from '@app/common';

@Module({
  imports: [
    // DbModule,
    CommonModule,
    MulterModule.registerAsync({
      useFactory(){
        return {
          dest: 'uploads'
        }
      }
    }),
    // MulterModule.register({
    //   dest: 'uploads', // 服务器存储
    //   storage: MAO({
    //     config: {
    //       region: 'oss-cn-hangzhou',
    //       accessKeyId: 'oss-cn-hangzhou',
    //       accessKeySecret: 'oss-cn-hangzhou',
    //       bucket: 'oss-cn-hangzhou',
    //     }
    //   }) // oss 存储
    // }),
    UsersModule,
    EpisodesModule,
    CoursesModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
